Estimating cardinality selectivity utilizing artificial neural networks

ABSTRACT

A database query comprising predicates may be received. Each predicate may operate on database columns. The database query may be determined to comprise strict operators. An upper bound neural network may be defined for calculating an adjacent upper bound and a lower bound neural network may be defined for calculating an adjacent lower bound. The upper bound neural network and the lower bound neural network may be trained using a selected value from data of a database table associated with the database query to be executed through the upper bound neural network and the lower bound neural network. The upper bound neural network and the lower bound neural network may be adjusted by passing in an expected value using an error found in expressions. The adjacent lower bound and the adjacent upper bound may be calculated in response to completion of initial training for the database columns.

STATEMENT REGARDING PRIOR DISCLOSURES BY THE INVENTOR OR A JOINTINVENTOR

Aspects of the present invention have been disclosed by the inventors inthe paper “Cardinality Estimation Using Neural Networks”, published inthe Proceedings of the 25th Annual International Conference on ComputerScience and Software Engineering (CASCON '15), made available to thepublic on Nov. 2, 2015. The following disclosure is submitted under 35U.S.C. § 102(b)(1)(A).

BACKGROUND

The present invention relates generally to the field of data processing,and more particularly to query optimization.

Query optimization may be a function of many relational databasemanagement systems (DBMS). A query optimizer may attempt to determine anefficient way to execute a given database query by considering possiblequery plans. A query plan may be a strategic method to access data in aDBMS. Additionally, the query optimizer cannot be accessed directly by auser submitting the database query. Once a database query is submittedto a database server, and parsed by a parser, the database query maythen be passed to the query optimizer where a query plan may bedeveloped. Query optimization may be a process for retrieving datawithin a DBMS that is most closely related to the DBMS query.

SUMMARY

According to one exemplary embodiment, a processor-implemented methodfor an adjacent value estimator for a cardinality estimation using anartificial neural network. The method may include receiving a databasequery comprising one or more predicates, whereby each predicate in theone or more predicates operates on one or more database columns of adatabase. The method may further include determining the receiveddatabase query comprises one or more strict operators. The method mayfurther include defining an upper bound neural network for calculatingan adjacent upper bound and a lower bound neural network for calculatingan adjacent lower bound based on receiving a database query. The methodmay further include training the defined upper bound neural network andthe defined lower bound neural network using a selected value from aplurality of data within a database table associated with the receiveddatabase query to be executed through the defined upper bound neuralnetwork and the defined lower bound neural network. The method mayfurther include adjusting the defined upper bound neural network and thedefined lower bound neural network by inputting an expected value usingan error found in one or more expressions based on training the definedupper bound neural network and the defined lower bound neural network.The method may further include calculating the adjacent lower bound andthe adjacent upper bound for a particular database column based onadjusting the defined upper bound neural network and the defined lowerbound neural network. The method may further include inputting thecalculated adjacent lower bound and calculated adjacent upper bound intothe artificial neural network. The method may further include estimatinga selectivity for the one or more database columns in response toinputting the calculated adjacent lower bound and calculated adjacentupper bound into the artificial neural network. The method may furtherinclude inputting the calculated adjacent lower bound and calculatedadjacent upper bound in a query optimization process based on estimatingthe selectivity for the one or more database columns. The method mayfurther include modifying the received database query with a pluralityof equivalent non-strict operations for approximate query processing.

According to another exemplary embodiment, a computer system for anadjacent value estimator for cardinality estimation using an artificialneural network is provided. The computer system may include one or moreprocessors, one or more computer-readable memories, one or morecomputer-readable tangible storage devices, and program instructionsstored on at least one of the one or more storage devices for executionby at least one of the one or more processors via at least one of theone or more memories, whereby the computer system is capable ofperforming a method. The method may include receiving a database querycomprising one or more predicates, whereby each predicate in the one ormore predicates operates on one or more database columns of a database.The method may further include determining the received database querycomprises one or more strict operators. The method may further includedefining an upper bound neural network for calculating an adjacent upperbound and a lower bound neural network for calculating an adjacent lowerbound based on receiving a database query. The method may furtherinclude training the defined upper bound neural network and the definedlower bound neural network using a selected value from a plurality ofdata within a database table associated with the received database queryto be executed through the defined upper bound neural network and thedefined lower bound neural network. The method may further includeadjusting the defined upper bound neural network and the defined lowerbound neural network by inputting an expected value using an error foundin one or more expressions based on training the defined upper boundneural network and the defined lower bound neural network. The methodmay further include calculating the adjacent lower bound and theadjacent upper bound for a particular database column based on adjustingthe defined upper bound neural network and the defined lower boundneural network. The method may further include inputting the calculatedadjacent lower bound and calculated adjacent upper bound into theartificial neural network. The method may further include estimating aselectivity for the one or more database columns in response toinputting the calculated adjacent lower bound and calculated adjacentupper bound into the artificial neural network. The method may furtherinclude inputting the calculated adjacent lower bound and calculatedadjacent upper bound in a query optimization process based on estimatingthe selectivity for the one or more database columns. The method mayfurther include modifying the received database query with a pluralityof equivalent non-strict operations for approximate query processing.

According to yet another exemplary embodiment, a computer programproduct for an adjacent value estimator for cardinality estimation usingan artificial neural network is provided. The computer program productmay include one or more computer-readable storage devices and programinstructions stored on at least one of the one or more tangible storagedevices, the program instructions executable by a processor. Thecomputer program product may include program instructions to receive adatabase query comprising one or more predicates, whereby each predicatein the one or more predicates operates on one or more database columnsof a database. The computer program product may further include programinstructions to determine the received database query comprises one ormore strict operators. The computer program product may further includeprogram instructions to define an upper bound neural network forcalculating an adjacent upper bound and a lower bound neural network forcalculating an adjacent lower bound based on receiving a database query.The computer program product may further include program instructions totrain the defined upper bound neural network and the defined lower boundneural network using a selected value from a plurality of data within adatabase table associated with the received database query to beexecuted through the defined upper bound neural network and the definedlower bound neural network. The computer program product may furtherinclude program instructions to adjust the defined upper bound neuralnetwork and the defined lower bound neural network by inputting anexpected value using an error found in one or more expressions based ontraining the defined upper bound neural network and the defined lowerbound neural network. The computer program product may further includeprogram instructions to calculate the adjacent lower bound and theadjacent upper bound for a particular database column based on adjustingthe defined upper bound neural network and the defined lower boundneural network. The computer program product may further include programinstructions to input the calculated adjacent lower bound and calculatedadjacent upper bound into the artificial neural network. The computerprogram product may further include program instructions to estimate aselectivity for the one or more database columns in response toinputting the calculated adjacent lower bound and calculated adjacentupper bound into the artificial neural network. The computer programproduct may further include program instructions to input the calculatedadjacent lower bound and calculated adjacent upper bound in a queryoptimization process based on estimating the selectivity for the one ormore database columns. The computer program product may further includeprogram instructions to modify the received database query with aplurality of equivalent non-strict operations for approximate queryprocessing.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

These and other objects, features and advantages of the presentinvention will become apparent from the following detailed descriptionof illustrative embodiments thereof, which is to be read in connectionwith the accompanying drawings. The various features of the drawings arenot to scale as the illustrations are for clarity in facilitating oneskilled in the art in understanding the invention in conjunction withthe detailed description. In the drawings:

FIG. 1 illustrates a networked computer environment according to atleast one embodiment;

FIG. 2 is a functional block diagram of an adjacent value estimatorprogram, according to at least one embodiment;

FIG. 3A is a functional block diagram of an upper bound neural network,according to at least one embodiment;

FIG. 3B is a functional block diagram of a lower bound neural network,according to at least one embodiment;

FIG. 4 is an operational flowchart illustrating a query optimizationprocess according to at least one embodiment;

FIG. 5 is an operational flowchart illustrating an adjacent lower boundand an adjacent upper bound calculation process according to at leastone embodiment;

FIG. 6 is a block diagram of internal and external components ofcomputers and servers depicted in FIG. 1 according to at least oneembodiment;

FIG. 7 is a block diagram of an illustrative cloud computing environmentincluding the computer system depicted in FIG. 1, in accordance with anembodiment of the present disclosure; and

FIG. 8 is a block diagram of functional layers of the illustrative cloudcomputing environment of FIG. 7, in accordance with an embodiment of thepresent disclosure.

DETAILED DESCRIPTION

Detailed embodiments of the claimed structures and methods are disclosedherein; however, it can be understood that the disclosed embodiments aremerely illustrative of the claimed structures and methods that may beembodied in various forms. This invention may, however, be embodied inmany different forms and should not be construed as limited to theexemplary embodiments set forth herein. Rather, these exemplaryembodiments are provided so that this disclosure will be thorough andcomplete and will fully convey the scope of this invention to thoseskilled in the art. In the description, details of well-known featuresand techniques may be omitted to avoid unnecessarily obscuring thepresented embodiments.

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

Aspects of the present disclosure relate to improving databasemanagement system (DBMS) query optimization. Hereinafter, a DBMS querymay be referred to as a database query. More specifically, aspects ofthe present disclosure relate to improving an estimation of the numberof qualified rows returned from a query. Hereinafter, the termcardinality is used to denote the number of qualified rows of a databasetable returned from a query. Additionally, reducing the cardinality of aquery can reduce resource utilization in a DBMS. Furthermore, reducingthe cardinality of a query can be accomplished by improving queryoptimization. A neural network may be utilized in order to improve queryoptimization by improving the accuracy of the estimated cardinality.

An index may be a data structure that may improve the speed of dataretrieval operations on a database table by creating a key for aparticular row or column in the database table. A database queryoptimizer may have a variety of access plans for each DBMS query. Theremay be a variety of access plans when the data in a database is notevenly distributed throughout the database columns and each plan may bean alternative method of retrieving the data. A database query optimizermay associate a cost to each access plan considered and may choose theaccess plan with a minimal cost. One of the key attributes to properlyassessing the cost of each alternative access plan may be to estimatethe cardinality of the stream at each stage in each particular accessplan.

A predicate is an element of a database query that may express or implya comparison operation. For example, a predicate can be an operationalsymbol, such as greater than (>), less than (<), greater than or equalto (>=), less than or equal to (<=), or equal to (=). Predicates may beused to reduce the scope of data retrieval that may be returned by thedatabase query. For example, reducing the scope can include reducing thenumber of rows in a database table to search for particular data.Moreover, using predicates to reduce the scope of a database query canreduce the total amount of resources used by a computer.

The application of one or more predicates within a database query mayreduce an output stream cardinality. Treating predicates independentlymay be common when computing the predicates filtering effect on thecardinality. However, the predicates can be statistically correlated;therefore, the combined filtering effect of predicates may not be theproduct of individually filtering an upper bound and a lower boundwithin a database query. This is a common problem in the field of queryoptimization. Furthermore, to accurately estimate the cardinality whenmultiple predicates are applied, a database administrator (DBA) mustdetermine the appropriate set of statistics to collect.

Therefore, it may be advantageous to, among other things, provide asystem to estimate the selectivity of a database query utilizing one ormore trained neural networks to reduce the search scope within one ormore columns in a database according to a received database query.

The following described exemplary embodiments provide a system, method,and program product to reduce a scope of data retrieval for databasequeries. As such, the present embodiment has the capacity to improve thetechnical field of data processing by utilizing neural networks toimprove database queries. More specifically, estimating an adjacentupper bound and an adjacent lower bound by inputting an upper bound toan upper bound neural network and a lower bound into a lower boundneural network.

Aspects of the present disclosure may improve estimating the cardinalityof a database query by using artificial neural networks (ANNs) to learnfunctions representing the combined selectivity of multiplestatistically correlated predicates of any non-subquery relationaloperation. User input may be provided to guide the learning stage. ANNsmay be utilized to learn functions that may accurately estimate theselectivity of multiple statistically correlated predicates in order toimprove the performance of database queries and to reduce the amount ofinput required by the user to achieve this accuracy in selectivityestimation. Aspects of the present disclosure may account for allrelational operators (e.g., <, >, >=, <=, and =) used within a databasequery. Furthermore, using ANNs in relation to DBMS queries may beeffective for multiple statistically correlated columns with data in anytype distribution (e.g., non-uniform distribution). Utilizing ANNs toimprove database query optimization may reduce a need for user input toachieve the improved accuracy in the cardinality estimates. Furthermore,utilizing ANNs significantly reduces the amount of statistics that needto be collected from data and data location within a particulardatabase. Moreover, utilizing ANNs to improve database queryoptimization may use a dynamic feedback approach to automatically adaptthe ANN estimates as the database changes (e.g., adding data to thedatabase). Utilizing ANNs to improve database query optimization mayrequire little disk space for storage.

The result of a database query may be sufficient if approximated.Hereinafter, an approximated query result can be referred to asapproximate query processing (AQP). For simplicity, in the followingexample, a database column may be referred to as COL and a first columnin a database may be referred to as COL1. Additionally, a value within adatabase column (e.g., COL1) may be referred to as val and val9 mayrefer to a value of nine. Predicates COL1>val9 and COL2=val100 may beused to delimit the end ranges of an index with a key including a firstcolumn and a second column (COL1, COL2):

Transforming COL1>val9 to COL1>=val10, where val10 is the value adjacentto val9 (i.e. val9+), allows for a reduction in the range of values thatneeds to be accessed in column one of the database:

This replacement of a strict range operation (>) with a non-strict rangeoperation (>=) reduces the resources required to process the query andthe result may be sufficient for the purposes of AQP.

Herein, a range predicate may be a conjunction of two Boolean terms withthe strict range operators (e.g., operators > and <) applied on the samedatabase column. For example, the range predicate can take the form ofcol>=i and col<=u, where i is a lower bound and u is an upper bound of aparticular range that may exist in a database column and where col is aparticular column within a database. Moreover, the expression may bedatabase search query to search a particular column of a databasestarting from the lower bound (i.e., i) and ending at the upper bound(i.e., u). Neural network architecture may assume that predicates onlycontain non-strict range operators, (e.g., operators >= and <=). Fromthese two operators, an equality operator may derived by theequivalence: col=x

x<=col<=x. However, an approach to utilize expressions that includestrict range operators is described herein. A solution to extend the useof neural network to any relational operator (e.g., strict-rangeoperators) is provided.

To extend the functionality of the neural network to other relationaloperators, the following equivalence: i<col<u

i⁺<=col<=u⁻ may be utilized, where i⁺ represents the smallest valuegreater than the lower bound i and where u⁻ represents the largest valuesmaller than the upper bound u, where i and u are values within aparticular database column. A database query containing predicates withstrict operators may be rewritten into a database query containing onlypredicates with non-strict operators, given a mechanism for finding i⁺and u⁻ for any value of any column in a database table. Therefore, allrelational operators may be handled when training neural networks.Instead of keeping an index on every database column, which becomesinefficient for larger tables, accurately estimating i⁺ and u⁻ may beaccomplished via neural networks. An augmented neural network may beapplied to the lower bound and the upper bound for each column of thedatabase table. For example, the lower bound (i.e., i) may be input to alower bound neural network to estimate an adjacent lower bound (i.e.,i⁺). Additionally, the upper bound (i.e., u) may be input to an upperbound neural network to estimate an adjacent upper bound (i.e., u⁻).These additional neural networks (i.e., the lower bound neural networkand the upper bound neural network) may be referred to as a set ofestimators, and they may be trained simultaneously with a main neuralnetwork by using set values from a training query generator. An adjacentvalue estimator program may produce an estimate for i⁺ and u⁻ for eachcolumn using the lower bound neural network and the upper bound neuralnetwork.

Referring to FIG. 1, an exemplary networked computer environment 100 inaccordance with one embodiment is depicted. The networked computerenvironment 100 may include a computer 102 with a processor 104 and adata storage device 106 that is enabled to run a software program 108and an adjacent value estimator program 110 a. The networked computerenvironment 100 may also include a server 120 that is enabled to run anadjacent value estimator program 110 b that may interact with a database114 and a communication network 130. The networked computer environment100 may include a plurality of computers 102 and servers 120, only oneof which is shown. The communication network 130 may include varioustypes of communication networks, such as a wide area network (WAN),local area network (LAN), a telecommunication network, a wirelessnetwork, a public switched network and/or a satellite network. It shouldbe appreciated that FIG. 1 provides only an illustration of oneimplementation and does not imply any limitations with regard to theenvironments in which different embodiments may be implemented. Manymodifications to the depicted environments may be made based on designand implementation requirements.

The client computer 102 may communicate with the server computer 120 viathe communications network 130. The communications network 130 mayinclude connections, such as wire, wireless communication links, orfiber optic cables. As will be discussed with reference to FIG. 6,server computer 120 may include internal components 902 a and externalcomponents 904 a, respectively, and client computer 102 may includeinternal components 902 b and external components 904 b, respectively.Server computer 120 may also operate in a cloud computing service model,such as Software as a Service (SaaS), Platform as a Service (PaaS), orInfrastructure as a Service (IaaS). Server 120 may also be located in acloud computing deployment model, such as a private cloud, communitycloud, public cloud, or hybrid cloud. Client computer 102 may be, forexample, a mobile device, a telephone, a personal digital assistant, anetbook, a laptop computer, a tablet computer, a desktop computer, orany type of computing devices capable of running a program, accessing anetwork, and accessing a database 114. According to variousimplementations of the present embodiment, the adjacent value estimatorprogram 110 a, 110 b may interact with a database 114 that may beembedded in various storage devices, such as, but not limited to acomputer/mobile device 102, a networked server 120, or a cloud storageservice.

According to the present embodiment, a user using a client computer 102or a server computer 120 may use the adjacent value estimator program110 a, 110 b (respectively) to improve database query optimization byusing neural networks to estimate an adjacent lower bound and anadjacent upper bound to improve the cardinality estimate of a DBMS queryand for reducing resources for AQP. The adjacent value estimation methodis explained in more detail below with respect to FIGS. 2-5.

Referring now to FIG. 2, a functional block diagram of an adjacent valueestimator program 110 a, 110 b is depicted, in accordance with oneembodiment of the present invention. The adjacent value estimatorprogram 110 a, 110 b may include a database query receiver 202, a queryparser 204, a query modifier 206, an upper bound neural network 208, anda lower bound neural network 210.

The database query receiver 202 may be a program (e.g., software program108 (FIG. 1)) capable of receiving a database query sent by a user or aclient computer (e.g., 102 (FIG. 1)). The database query receiver 202may be capable of processing various types of database queries (e.g., aDBMS query, a relational database query, or any type of query associatedwith retrieving data from a database). The database query may beexpressed in structured query language (SQL), C++, or anotherprogramming language. The database query received by the database queryreceiver 202 may include one or more predicates that contain one or moreoperators that may operate on one or more database columns. For example,a database query for retrieving data from a column col of a database(e.g., 114 (FIG. 1)) starting from a lower bound i within column x ofdatabase t and ending at an upper bound u within the column x ofdatabase t can be in the form of i<t.colx>u. The predicates of theexample database query may be the < relational operators. Moreover, thedatabase query may include only range predicates with one or more strictoperators (e.g., <, >).

The query parser 204 may be a program capable of analyzing the databasequery into logical syntactic components. For example, the query parser204 may identify the < operators, the lower bound i, the upper bound u,and/or the column colx. Furthermore, the query parser may determinewhether the database query conforms to the rules of a particularprogramming language associated with the database (e.g., SQL).Additionally, the query parser may recognize strict operators (e.g.,<, >) within the database query that may need to be replaced bynon-strict operators (e.g., <=, >=).

The query modifier 206 may be a program capable of modifying a databasequery by replacing strict operators with non-strict operators. Thestrict range operators (e.g., < or >) may be expressed in terms of anon-strict range operator (e.g., =< or >=) according to the followingexpression: i<t.colx<u

i<=t.colx<=u, where i is a lower bound and u is an upper bound in columnx of a database table t. For example, the query modifier 206 may replacethe strict < operator with the non-strict <= operator. Additionally, thequery modifier 20 may replace the > strict operator with the >=non-strict operator. As an additional example, the query modifier 206may transform the database query i<t.colx<u received by the databasequery receiver 202 to a form of the database query i<=t.colx<=u.Transforming the database query may improve the performance of AQP bystarting data retrieval within a particular column of the database(e.g., 114 (FIG. 1)) at a larger numbered value and by ending dataretrieval within the database at a lower numbered value, therebyreducing the scope of the database search. Furthermore, computingresource expenditure may be reduced by narrowing the scope of thedatabase search.

The upper bound neural network 208 may be an ANN capable of estimatingan adjacent upper bound (i.e., u⁻) that is the largest value less thanthe upper bound u within the column x. For example, if upper bound u isthe upper bound of a column in a database query (e.g., i<t.colx<u), thenadjacent upper bound u⁻ may be the largest value within column x lessthan upper bound u. For example, if there are ten values in a column xof a database table (e.g., value one, . . . , value ten) and the upperbound is value ten, then the adjacent upper bound would be value nine.Furthermore, in reference to a relational database where data may not bedistributed evenly within each column, the upper bound neural network208 may replace an upper bound within a particular column with thelargest value less than the upper bound within the particular column orthe value most related to the database query.

The upper bound neural network 208 may have artificial neurons groupedinto one or more layers: an input layer, a hidden layer, and an outputlayer that will be discussed in FIG. 3A. An artificial neuron may be amathematical function conceived as a model of biological neurons.Artificial neurons may be units in an artificial neural network. Theupper bound neural network 208 may have appropriate weights computed foreach neuron that resides within the hidden layer. Furthermore, the upperbound neural network 208 may be trained according to training dataderived from metadata related to known column data distributionstatistical methods. The column data distribution statistics may bestatistics of how the data is distributed throughout the database tableand how data is distributed within each column of the database table.Furthermore, the upper bound neural network 208 may have been trained bytesting database queries including predicates for which the resultingcardinalities are known. Moreover, the upper bound neural network 208may have been trained by executing test queries with various predicatesto determine known resulting cardinalities for the training data.Training the upper bound neural network 208 may improve an approximationof estimating the adjacent upper bound u⁻.

The lower bound neural network 210 may be an ANN capable of estimatingan adjacent lower bound that is the smallest value greater than thelower bound. For example, if lower bound i is the lower bound of aparticular column x in database query (e.g., i<t.colx<u), then lowerbound i⁺ may be the smallest value greater than lower bound i. Forexample, if there are ten values within a particular column x in adatabase table t (e.g., value one, . . . , value ten) and the lowerbound value may be value one, then the adjacent lower bound value wouldbe value two. Furthermore, in reference to a relational database wheredata may not be distributed evenly within each column, the lower boundneural network 210 may replace a lower bound value within a particularcolumn with the smallest value greater than the lower bound value withinthe particular column.

The lower bound neural network 210 may have neurons grouped into one ormore layers: an input layer, a hidden layer, and an output layer thatwill be discussed in FIG. 3B. An artificial neuron may be a mathematicalfunction conceived as a model of biological neurons. Artificial neuronsmay be units in an artificial neural network. The lower bound neuralnetwork 210 may have appropriate weights computed for each neuron thatresides within the hidden layer. Furthermore, the lower bound neuralnetwork 210 may be trained according to training data derived frommetadata related to known column data distribution statistical methods.The column data distribution statistics may be statistics of how thedata is distributed throughout the database table and how data isdistributed within each column of the database table. Furthermore, thelower bound neural network 210 may have been trained by testing queriesincluding predicates for which the resulting cardinalities are known.Moreover, the lower bound neural network 210 may have been trained byexecuting test queries with various predicates to determine knownresulting cardinalities for the training data. Training the lower boundneural network 210 may improve an approximation of estimating theadjacent lower bound i⁺.

Referring now to FIG. 3A, a functional block diagram of an upper boundneural network 208 is depicted, in accordance with one embodiment of thepresent invention. The upper bound neural network 208 may be afeedforward neural network where connections between the three layers ofgrouped neurons (i.e. the input layer 302, the hidden layer 304, and theoutput layer 306) do not form a cycle (i.e., no looping connections).For example, each output from each neuron in the hidden layer 304 is theinput for each neuron in the output layer 306 and do not loop backaround for input to hidden layer 304 or to input layer 302.

The input layer 302 may include a bias 308 and an upper bound 310 asinputs. The bias 308 may be a value of one since the bias 308 may nothave an input. The upper bound u 312 may be inputted to the upper bound310. Additionally, the upper bound u 312 may be included in a databasequery within a value of a relational database column that exists in acolumn of a database table. The upper bound 310 may be inputted intoeach neuron of the hidden layer 304. Each neuron of the hidden layer 304may apply a weight to the upper bound 310 according to a jump activationfunction. The jump activation function may be defined as:

${\varphi_{k}(x)} = \{ {\begin{matrix}0 & {{{for}\mspace{14mu} x} < 0} \\( {1 - e^{- x}} )^{k} & {{{for}\mspace{14mu} x} \geq 0}\end{matrix},} $where x is a value computed from one or more inputs to each neuron inthe hidden layer 304 and k is a positive integer. Furthermore, eachweight applied to each neuron may depend on training data.

Hidden layer 304 may include neurons that may not be observable fromhidden layer's 304 inputs or outputs. Neurons in the hidden layer 304are grouped by the jump activation function that each neuron maycompute. The jump activation function may apply a weight to each neuronwithin the hidden layer 304. The weight may be in the form of anon-linear function that may depend on the training data, discussed inFIG. 2. Each neuron within the hidden layer 304 may be fully connectedto the input layer 302 (i.e., each neuron in the hidden layer 304 takesas input bias 308 and upper bound 310 within the input layer 302).

Similar to each neuron in the input layer 302 being connected to eachneuron in the hidden layer 304, the output layer 306 may be connected toevery neuron in the hidden layer 304. The output layer 306 may includeneuron 314 that may output adjacent upper bound u⁻ 316. Adjacent upperbound u⁻ 316 may be the largest value within a particular column that isless than the upper bound u 312. The adjacent upper bound u⁻ 316 may becalculated by the upper bound neural network 208. The calculation ofadjacent upper bound u⁻ 316 by the upper bound neural network 208 mayenable the database query containing strict range operators includingupper bound u 312 to be converted to a non-strict range operatorincluding adjacent upper bound u⁻ 316.

Referring now to FIG. 3B, a functional block diagram of a lower boundneural network 210 is depicted in more detail, in accordance with oneembodiment of the present invention. Lower bound neural network 210 is afeedforward neural network where connections between the layers, 322-326do not form a cycle. For example, each output from each neuron in thehidden layer 324 is the input for each neuron in the output layer 326and may not loop back around for input to hidden layer 324 or to inputlayer 322. The lower bound neural network 210 may include three layersof grouped neurons (nodes): input layer 322, hidden layer 324, andoutput layer 326.

The input layer 322 may include a bias 328 and a lower bound 330 asinput. The bias 328 may be a value of one since the bias 328 may nothave an input. The lower bound i 332 may be inputted to the lower bound330. Additionally, the lower bound i 332 may be included in a databasequery within a value of a relational database column that exists in acolumn of a database table. The lower bound i 332 may be inputted intoeach neuron of the hidden layer 324. Each neuron of the hidden layer 324may apply a weight to the lower bound i 332 according to the jumpactivation function. Furthermore, each weight applied to each neuron maydepend on the training data.

Hidden layer 324 may include neurons that are not observable from itsinputs or outputs. Neurons in the hidden layer 324 may be grouped by thejump activation function that they may compute. The jump activationfunction can apply a weight to each neuron within the hidden layer 324.The weight may be in the form of a non-linear function that may dependon the training data, discussed in FIG. 2. Each neuron within the hiddenlayer 324 is fully connected to the input layer 322 (i.e., each neuronin the hidden layer 324 takes as input 328 and lower bound 330 withinthe input layer 322).

Similar to each neuron in the input layer 322 being connected to eachneuron in the hidden layer 324, the output layer 326 may be connected toevery neuron in the hidden layer 324. The output layer 326 may includeneuron 334 that may output the adjacent lower bound i⁺ 336. Adjacentlower bound i⁺ 336 may be the smallest value within a particular columnthat is larger than the lower bound i 332. The adjacent lower bound i⁺336 may be calculated by the lower bound neural network 210. Thecalculation of adjacent lower bound i⁺ 336 by the lower bound neuralnetwork 210 may enable the database query containing strict rangeoperators including lower bound i 332 to be converted to a non-strictrange operator including adjacent lower bound i⁺ 336.

Referring now to FIG. 4, an operational flowchart illustrating a queryoptimization process 400 according to at least one embodiment isdepicted. At 402, the adjacent value estimator program 110 a, 110 b(FIG. 1) receives a database query that includes one or more strictrange predicates by the database query receiver 202 (FIG. 2). The one ormore strict range predicates of the database query may be in the form ofi=t.colx=u, where lower bound i 332 (FIG. 3B) may be a lower bound forsearching within column x of database t and upper bound u 312 (FIG. 3A)may be an upper bound for searching within column x of database t. Thestrict range predicate (e.g., <) may be operating on the lower bound i332 (FIG. 3B) and upper bound u 312 (FIG. 3A) of column x of database t.A database manager may create a variety of access plans, where eachaccess plan may vary for retrieving data from the database.

Next, at 404, the adjacent value estimator program 110 a, 110 b (FIG. 1)performs automatic command line parsing against the received databasequery by the query parser 204 (FIG. 2). The query parser 204 (FIG. 2)may be a software component that takes the database query and builds adata structure that gives a structural representation of the input andchecks for correct syntax in the process. The query parser 204 (FIG. 2)may analyze a string of symbols (e.g., a database query) that conformsto the rules of a programming language (e.g., SQL). The input data canbe database queries in one or more programming languages. However, theinput data can also be database queries in natural language or lessstructured textual data. A particular program of query parsing (e.g.,query parser 204 (FIG. 2)) can perform a function using regularexpressions (e.g., a sequence of characters that define a searchpattern), where a regular expression defines a regular language, andautomatically generate a parser for that language, allowing patternmatching and extraction of text within the received database query.Additionally, the adjacent value estimator program 110 a, 110 b (FIG. 1)may identify the strict range operators (e.g., < and >) within thedatabase query.

Then, at 406, the adjacent value estimator program 110 a, 110 b (FIG. 1)determines whether the database query includes one or more strictoperators. According to at least one embodiment, the query optimizationprocess 400 may continue along the operational flowchart if the databasequery includes one or more strict operators. The adjacent valueestimator program 110 a, 110 b (FIG. 1) can determine whether thedatabase query includes one or more strict operators by the query parser204 (FIG. 2) performing automatic command line parsing on the databasequery and then comparing operators within the database query to a knownlist of operators within the database 114 (FIG. 1). If the adjacentvalue estimator program 110 a, 110 b (FIG. 1) determines that thedatabase query includes one or more strict operators (step 406, “YES”branch), the query optimization process 400 may continue to modify thedatabase query so that the database query includes equivalent non-strictoperators at step 408. If the adjacent value estimator program 110 a,110 b (FIG. 1) determines the database query does not include one ormore strict operators (step 406, “NO” branch), the query optimizationprocess 400 may terminate.

At 408, the adjacent value estimator program 110 a, 110 b (FIG. 1)modifies the database query so that the database query includesequivalent non-strict operators (e.g., =<, >=) by the query modifier 206(FIG. 2). For example, the query modifier 206 (FIG. 2) may replace thestrict operators within the database query with equivalent non-strictoperators. For example, the query modifier 206 (FIG. 2) may apply thefollowing equivalence to the database query:i=t.colx=u

i⁺<=t.colx<=u⁻

Next, at 410, the adjacent value estimator program 110 a, 110 b (FIG. 1)inputs the upper bound u 312 (FIG. 3A) to the upper bound neural network208 (FIG. 2) and the lower bound i 332 (FIG. 3B) to the lower boundneural network 210 (FIG. 2). The upper bound neural network 208 (FIG. 2)and the lower bound neural network 210 (FIG. 2) may be initialized, thentrained using training data prior to receiving the input upper bound u312 (FIG. 3A) and the lower bound i 332 (FIG. 3B), respectively, as willbe discussed in more detail in FIG. 5. The output from the upper boundneural network 208 (FIG. 2) may be the adjacent upper bound u⁻ 316 (FIG.3A) and output from the lower bound neural network 210 (FIG. 2) may bethe adjacent lower bound i⁺ 336 (FIG. 3B). Both the adjacent upper boundu⁻ 316 (FIG. 3A) and the adjacent lower bound i⁺ 336 (FIG. 3B) may beinput to a main neural network to estimate the selectivity of aparticular column for a database table.

Referring now to FIG. 5, an operational flowchart illustrating anadjacent lower bound and an adjacent upper bound calculation process 500according to at least one embodiment is depicted. The following depictedalgorithm maybe translated to any programming language (e.g., C++, SQL,etc . . . ). Aspects of the present disclosure may be implementedaccording to the following algorithm:

BEGIN FOR each column Ci NN_plus_i = InitializeNeuralNetwork( );NN_minus_i = InitializeNeuralNetwork( ); WHILECONTINUE_TRAINING(NN_plus_i, NN_minus_i) DO Xi = Ci−>PickRandomValue( );Xi+ = Ci−>NextValue(X); Xi− = Ci−>PreviousValue(X); Xi+_estimate =NN_plus_i−>Run(Xi); Xi−_estimate = NN_minus_i−>Run(Xi);NN_plus_i−>Train(Xi+); NN_minus_i−>Train(Xi−); END END

At 502, the adjacent value estimator program 110 a, 110 b (FIG. 1)initializes the upper bound neural network 208 (FIG. 2) and the lowerbound neural network 210 (FIG. 2). The adjacent value estimator program110 a, 110 b (FIG. 1) may initialize the upper bound neural network 208(FIG. 2) and the lower bound neural network 210 (FIG. 2) according tothe following section of an algorithm:

BEGIN

FOR each column Ci

NN_plus_i=InitializeNeuralNetwork( );

NN_minus_i=InitializeNeuralNetwork( );

Where NN_plus_i represents the neural network to estimate x+ for columnCi and NN_minus_i represents the neural network to estimate x− forcolumn Ci.

Next, at 504, the adjacent value estimator program 110 a, 110 b (FIG. 1)trains the upper bound neural network 208 (FIG. 2) and the lower boundneural network 210 (FIG. 2) by a preconfigured training algorithm.Training the upper bound neural network 208 (FIG. 2) and the lower boundneural network 210 (FIG. 2) may be accomplished by known statisticalmethods. Furthermore, the known statistical methods may rely on how thedata is statistically distributed throughout the database. Additionally,the adjacent value estimator program 110 a, 110 b (FIG. 1) may train theupper bound neural network 208 (FIG. 2) and the lower bound neuralnetwork 210 (FIG. 2) according to the following section of thealgorithm:

WHILE CONTINUE_TRAINING(NN_plus_i, NN_minus_i)

DO

Then, at 506, the adjacent value estimator program 110 a, 110 b (FIG. 1)selects a value from data within the database table to run through theupper bound neural network 208 (FIG. 2) and the lower bound neuralnetwork 210 (FIG. 2) by a preconfigured algorithm. For simplicity, auser-selected known search technique for training may be used.Furthermore, the adjacent value estimator program 110 a, 110 b (FIG. 1)may select a value from the data within the database table and runthrough the upper bound neural network 208 (FIG. 2) and the lower boundneural network 210 (FIG. 2) according to the following section of thealgorithm:

Xi=Ci−>PickRandomValue( );

Xi+=Ci−>NextValue(X);

Xi−=Ci−<PrevoiusValue(X);

Where Xi may be a user-selected value from a group of values, Xi+ may bea next user-selected value from the group of values, and Xi− may be aprevious user-selected value from the group of values.

At 508, the adjacent value estimator program 110 a, 110 b (FIG. 1)ignores the resulting output from the upper bound neural network 208(FIG. 2) and the lower bound neural network 210 (FIG. 2) from step 506by the preconfigured algorithm. The first iteration through the twoneural networks initiates the next iteration in training required bystep 510. Moreover, the adjacent value estimator program 110 a, 110 b(FIG. 1) ignores the resulting output from the upper bound neuralnetwork 208 (FIG. 2) and the lower bound neural network 210 (FIG. 2)from step 506 according to the following section of the algorithm:

Xi+_estimate=NN_plus_i−>Run(Xi);

Xi−_estimate=NN_minus_i−>Run(Xi);

Next, at 510, the adjacent value estimator program 110 a, 110 b (FIG. 1)continues to train the upper bound neural network 208 (FIG. 2) and thelower bound neural network 210 (FIG. 2) by passing in an expected valuefrom which upper bound neural network 208 (FIG. 2) and lower boundneural network 210 (FIG. 2) may each adjust based on an error. The errormay be determined based on a comparison of an output (e.g., adjacentupper bound u⁻ 316 (FIG. 3A) and adjacent lower bound i⁺ 336 (FIG. 3B))to an expected result. The adjacent value estimator program 110 a, 110 b(FIG. 1) continues to train the upper bound neural network 208 (FIG. 2)and the lower bound neural network 210 (FIG. 2) by passing in anexpected value from which upper bound neural network 208 (FIG. 2) andlower bound neural network 210 (FIG. 2) may each adjust based on anerror according to the following section of the algorithm:

NN_plus_i−>Train(Xi+);

NN_minus_i−>Train(Xi−);

END

Then, at 512, the adjacent value estimator program 110 a, 110 b (FIG. 1)determines whether the initial training is complete. Training may bedetermined to be completed when a threshold is reached (e.g., when theerror is below a numerical value). According to at least one embodiment,the adjacent lower bound and adjacent upper bound calculation process500 may continue along the operational flowchart if the initial trainingis complete. If the adjacent value estimator program 110 a, 110 b(FIG. 1) determines that the initial training is complete (step 512,“YES” branch), the adjacent lower bound and adjacent upper boundcalculation process 500 may continue to call the train function at step514. If the adjacent value estimator program 110 a, 110 b (FIG. 1)program determines the initial training is not complete (step 512, “NO”branch), the adjacent lower bound and adjacent upper bound calculationprocess 500 may return to step 504 to train the lower bound neuralnetwork 210 (FIG. 2) and the upper bound neural network 208 (FIG. 2).

Training may be an iterative process where a sample of data taken from adatabase is run through a neural network (e.g., upper bound neuralnetwork 208 (FIG. 2) and lower bound neural network 210 (FIG. 2)) andthe neural network may be self-adjusted by comparing an output (e.g.,adjacent upper bound u⁻ 316 (FIG. 3A) and adjacent lower bound i⁺ 336(FIG. 3B)) to an expected result. A simple implementation of trainingmay be to iterate the training a fixed number of times, N, which can bein the 100s to 10000s of iterations. Also, training can be performedmultiple times to produce multiple neural networks, of which one neuralnetwork may be selected according to a comparison of the output from theneural network to the expected result.

Next, at step 516, the adjacent value estimator program 110 a, 110b(FIG. 1) computes the adjacent upper bound and the adjacent lower bound.The adjacent value estimator program 110 a, 110 b (FIG. 1) computes theadjacent upper bound ui⁻ 316 (FIG. 3A)) and the adjacent lower bound li⁺336 (FIG. 3B)) by inputting adjacent upper bound u⁻ 316 (FIG. 3A) andadjacent lower bound i⁺ 336 (FIG. 3B) into the upper bound neuralnetwork 208 (FIG. 2) and the lower bound neural network 210 (FIG. 2).Furthermore, the adjacent value estimator program 110 a, 110b (FIG. 1)computes the adjacent upper bound and the adjacent lower bound accordingto the following section of the algorithm:

li⁺=NN_plus_i−>Run(li);

ui⁻=NN_minus_i−>Run(ui);

Then, at step 518, the adjacent value estimator program 110 a, 110b(FIG. 1) inputs an estimated adjacent upper bound ui⁻ (i.e., u⁻ 316(FIG. 3A)) and an estimated adjacent lower bound (i.e., i⁺ 336 (FIG.3B)) into a main neural network. The main neural network may output anestimation of a selectivity of a particular column of a particulardatabase between the adjacent upper bound ui⁻ (i.e., u⁻ 316 (FIG. 3A))and the adjacent lower bound li⁺ (i.e., i⁺ 336 (FIG. 3B)) according tothe following section of the algorithm:

selectivity=NN_sel−>Run(ui⁻, li⁺);

END

It may be appreciated that FIGS. 2-5 provide only an illustration of oneembodiment and do not imply any limitations with regard to how differentembodiments may be implemented. Many modifications to the depictedembodiment(s) may be made based on design and implementationrequirements.

FIG. 6 is a block diagram 900 of internal and external components ofcomputers depicted in FIG. 1 in accordance with an illustrativeembodiment of the present invention. It should be appreciated that FIG.6 provides only an illustration of one implementation and does not implyany limitations with regard to the environments in which differentembodiments may be implemented. Many modifications to the depictedenvironments may be made based on design and implementationrequirements.

Data processing system 902, 904 is representative of any electronicdevice capable of executing machine-readable program instructions. Dataprocessing system 902, 904 may be representative of a smart phone, acomputer system, PDA, or other electronic devices. Examples of computingsystems, environments, and/or configurations that may represented bydata processing system 902, 904 include, but are not limited to,personal computer systems, server computer systems, thin clients, thickclients, hand-held or laptop devices, multiprocessor systems,microprocessor-based systems, network PCs, minicomputer systems, anddistributed cloud computing environments that include any of the abovesystems or devices.

User client computer 102 (FIG. 1), and network server 120 (FIG. 1) mayinclude respective sets of internal components 902 a, b and externalcomponents 904 a, b illustrated in FIG. 6. Each of the sets of internalcomponents 902 a, b includes one or more processors 906, one or morecomputer-readable RAMs 908, and one or more computer-readable ROMs 910on one or more buses 912, and one or more operating systems 914 and oneor more computer-readable tangible storage devices 916. The one or moreoperating systems 914 and the software program 108 (FIG. 1) and theadjacent value estimator program 110 a (FIG. 1) in client computer 102(FIG. 1) and the adjacent value estimator program 110 b (FIG. 1) innetwork server 120 (FIG. 1) may be stored on one or morecomputer-readable tangible storage devices 916 for execution by one ormore processors 906 via one or more RAMs 908 (which typically includecache memory). In the embodiment illustrated in FIG. 6, each of thecomputer-readable tangible storage devices 916 is a magnetic diskstorage device of an internal hard drive. Alternatively, each of thecomputer-readable tangible storage devices 916 is a semiconductorstorage device such as ROM 910, EPROM, flash memory or any othercomputer-readable tangible storage device that can store a computerprogram and digital information.

Each set of internal components 902 a, b also includes a R/W drive orinterface 918 to read from and write to one or more portablecomputer-readable tangible storage devices 920 such as a CD-ROM, DVD,memory stick, magnetic tape, magnetic disk, optical disk orsemiconductor storage device. A software program, such as the softwareprogram 108 (FIG. 1) and the adjacent value estimator program 110 a, 110b (FIG. 1), can be stored on one or more of the respective portablecomputer-readable tangible storage devices 920, read via the respectiveR/W drive or interface 918, and loaded into the respective hard drive916.

Each set of internal components 902 a, b may also include networkadapters (or switch port cards) or interfaces 922 such as a TCP/IPadapter cards, wireless wi-fi interface cards, or 3G or 4G wirelessinterface cards or other wired or wireless communication links. Thesoftware program 108 (FIG. 1) and the adjacent value estimator program110 a (FIG. 1) in client computer 102 (FIG. 1) and the adjacent valueestimator program 110 b (FIG. 1) in network server computer 120 (FIG. 1)can be downloaded from an external computer (e.g., server) via a network(for example, the Internet, a local area network or other, wide areanetwork) and respective network adapters or interfaces 922. From thenetwork adapters (or switch port adaptors) or interfaces 922, thesoftware program 108 (FIG. 1) and the adjacent value estimator program110 a (FIG. 1) in client computer 102 (FIG. 1) and the adjacent valueestimator program 110 b (FIG. 1) in network server computer 120 (FIG. 1)are loaded into the respective hard drive 916. The network may comprisecopper wires, optical fibers, wireless transmission, routers, firewalls,switches, gateway computers and/or edge servers.

Each of the sets of external components 904 a, b can include a computerdisplay monitor 924, a keyboard 926, and a computer mouse 928. Externalcomponents 904 a, b can also include touch screens, virtual keyboards,touch pads, pointing devices, and other human interface devices. Each ofthe sets of internal components 902 a, b also includes device drivers930 to interface to computer display monitor 924, keyboard 926, andcomputer mouse 928. The device drivers 930, R/W drive or interface 918,and network adapter or interface 922 comprise hardware and software(stored in storage device 916 and/or ROM 910).

It is understood in advance that although this disclosure includes adetailed description on cloud computing, implementation of the teachingsrecited herein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g. networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure comprising anetwork of interconnected nodes.

Referring now to FIG. 7, illustrative cloud computing environment 1000is depicted. As shown, cloud computing environment 1000 comprises one ormore cloud computing nodes 100 with which local computing devices usedby cloud consumers, such as, for example, personal digital assistant(PDA) or cellular telephone 1000A, desktop computer 1000B, laptopcomputer 1000C, and/or automobile computer system 1000N may communicate.Nodes 100 may communicate with one another. They may be grouped (notshown) physically or virtually, in one or more networks, such asPrivate, Community, Public, or Hybrid clouds as described hereinabove,or a combination thereof. This allows cloud computing environment 1000to offer infrastructure, platforms and/or software as services for whicha cloud consumer does not need to maintain resources on a localcomputing device. It is understood that the types of computing devices1000A-N shown in FIG. 7 are intended to be illustrative only and thatcomputing nodes 100 and cloud computing environment 1000 can communicatewith any type of computerized device over any type of network and/ornetwork addressable connection (e.g., using a web browser).

Referring now to FIG. 8, a set of functional abstraction layers 1100provided by cloud computing environment 1000 (FIG. 7) is shown. Itshould be understood in advance that the components, layers, andfunctions shown in FIG. 8 are intended to be illustrative only andembodiments of the invention are not limited thereto. As depicted, thefollowing layers and corresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provide cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may comprise applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provide pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and adjacent value estimation 96. Adjacentvalue estimation 96 provides a way to improve database queries by anadjacent value estimator program 110 a, 110 b (FIG. 1) utilizing neuralnetworks to estimate an adjacent upper bound and an adjacent lower boundin order to reduce the scope of data retrieval within a particularcolumn of the database.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

What is claimed is:
 1. A computer system for an adjacent value estimatorfor cardinality estimation using an artificial neural network,comprising: one or more processors, one or more computer-readablememories, one or more computer-readable tangible storage medium, andprogram instructions stored on at least one of the one or more tangiblestorage medium for execution by at least one of the one or moreprocessors via at least one of the one or more memories, wherein thecomputer system is capable of performing a method comprising: receivinga database query comprising one or more predicates, wherein eachpredicate in the one or more predicates operates on one or more databasecolumns of a database; determining the received database query comprisesone or more strict operators; defining an upper bound neural network forcalculating an adjacent upper bound and a lower bound neural network forcalculating an adjacent lower bound based on receiving a database query;training the defined upper bound neural network and the defined lowerbound neural network using a selected value from a plurality of datawithin a database table associated with the received database query tobe executed through the defined upper bound neural network and thedefined lower bound neural network; adjusting the defined upper boundneural network and the defined lower bound neural network by inputtingan expected value using an error found in one or more expressions basedon training the defined upper bound neural network and the defined lowerbound neural network; calculating the adjacent lower bound and theadjacent upper bound for a particular database column based on adjustingthe defined upper bound neural network and the defined lower boundneural network; inputting the calculated adjacent lower bound andcalculated adjacent upper bound into the artificial neural network;estimating a selectivity for the one or more database columns inresponse to inputting the calculated adjacent lower bound and calculatedadjacent upper bound into the artificial neural network; inputting thecalculated adjacent lower bound and calculated adjacent upper bound in aquery optimization process based on estimating the selectivity for theone or more database columns; and modifying the received database querywith a plurality of equivalent non-strict operations for approximatequery processing.
 2. The computer system of claim 1, wherein cardinalitydenotes a number of qualified rows associated with a stream at eachstage in an access plan, and wherein the artificial neural network has aplurality of layers and comprises a plurality of neurons in a hiddenlayer within the plurality of layers grouped by a jump activationfunction, and wherein each neuron within the plurality of neurons isfully connected to an input layer within the plurality of layersenabling each neuron in the hidden layer within the plurality of layersto take a plurality of input neurons as input, and wherein an outputlayer within the plurality of layers is connected to each neuron in thehidden layer.
 3. The computer system of claim 2, wherein the jumpactivation function is defined as${\varphi_{k}(x)} = \{ {\begin{matrix}0 & {{{for}\mspace{14mu} x} < 0} \\( {1 - e^{- x}} )^{k} & {{{for}\mspace{14mu} x} \geq 0}\end{matrix},} $ and wherein x is a value computed from one ormore inputs to each neuron in the hidden layer and k is a positiveinteger.
 4. The computer system of claim 1, wherein the database queryis modified according to an expression i<col<u⇐⇒i⁺≤col≤u⁻, wherein i⁺denotes a smallest value greater than i in a respective column of thedatabase, and wherein u⁻ denotes a largest value smaller than u in therespective column of the database.
 5. The computer system of claim 1,wherein the adjacent lower bound and the adjacent upper bound areinputted to a non-strict range predicate selectivity artificial neuralnetwork to estimate a selectivity estimation of a range predicate. 6.The computer system of claim 1, wherein the database is a relationaldatabase including one or more rows and the one or more databasecolumns.
 7. The computer system of claim 1, wherein the database isinputted into a processor by a client computing device, and wherein theestimated selectivity is received by the client computing device.
 8. Acomputer program product for an adjacent value estimator for cardinalityestimation using an artificial neural network, comprising: one or morecomputer-readable storage medium and program instructions stored on atleast one of the one or more tangible storage medium, the programinstructions executable by a processor, the program instructionscomprising: program instructions to receive a database query comprisingone or more predicates, wherein each predicate in the one or morepredicates operates on one or more database columns of a database;program instructions to determine the received database query comprisesone or more strict operators; program instructions to define an upperbound neural network for calculating an adjacent upper bound and a lowerbound neural network for calculating an adjacent lower bound based onreceiving a database query; program instructions to train the definedupper bound neural network and the defined lower bound neural networkusing a selected value from a plurality of data within a database tableassociated with the received database query to be executed through thedefined upper bound neural network and the defined lower bound neuralnetwork; program instructions to adjust the defined upper bound neuralnetwork and the defined lower bound neural network by inputting anexpected value using an error found in one or more expressions based ontraining the defined upper bound neural network and the defined lowerbound neural network; program instructions to calculate the adjacentlower bound and the adjacent upper bound for a particular databasecolumn based on adjusting the defined upper bound neural network and thedefined lower bound neural network; program instructions to input thecalculated adjacent lower bound and calculated adjacent upper bound intothe artificial neural network; program instructions to estimate aselectivity for the one or more database columns in response toinputting the calculated adjacent lower bound and calculated adjacentupper bound into the artificial neural network; program instructions toinput the calculated adjacent lower bound and calculated adjacent upperbound in a query optimization process based on estimating theselectivity for the one or more database columns; and programinstructions to modify the received database query with a plurality ofequivalent non-strict operations for approximate query processing. 9.The computer program product of claim 8, wherein cardinality denotes anumber of qualified rows associated with a stream at each stage in anaccess plan, and wherein the artificial neural network has a pluralityof layers and comprises a plurality of neurons in a hidden layer withinthe plurality of layers grouped by a jump activation function, andwherein each neuron within the plurality of neurons is fully connectedto an input layer within the plurality of layers enabling each neuron inthe hidden layer within the plurality of layers to take a plurality ofinput neurons as input, and wherein an output layer within the pluralityof layers is connected to each neuron in the hidden layer.
 10. Thecomputer program product of claim 9, wherein the jump activationfunction is defined as ${\varphi_{k}(x)} = \{ {\begin{matrix}0 & {{{for}\mspace{14mu} x} < 0} \\( {1 - e^{- x}} )^{k} & {{{for}\mspace{14mu} x} \geq 0}\end{matrix},} $ and wherein x is a value computed from one ormore inputs to each neuron in the hidden layer and k is a positiveinteger.
 11. The computer program product of claim 8, wherein thedatabase query is modified according to an expressioni<col<u⇐⇒i⁺≤col≤u⁻, wherein i⁺ denotes a smallest value greater than iin a respective column of the database, and wherein u⁻ denotes a largestvalue smaller than u in the respective column of the database.
 12. Thecomputer program product of claim 8, wherein the adjacent lower boundand the adjacent upper bound are inputted to a non-strict rangepredicate selectivity artificial neural network to estimate aselectivity estimation of a range predicate.
 13. The computer programproduct of claim 8, wherein the database is a relational databaseincluding one or more rows and the one or more database columns.